import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';

PreferredSizeWidget appBar(BuildContext context, String? title, List<Widget>? actions, {bool black = true}) {
  return AppBar(
      actions: actions,
      title: Text(
        title ?? "",
        style: TextStyle(color: Color(black ? 0xFF202020 : 0xFFFFFFFF), fontSize: 18),
      ),
      backgroundColor: Colors.transparent,
      centerTitle: true,
      elevation: 0,
      titleSpacing: 0,
      leading: IconButton(
          tooltip: '',
          icon: Image.asset(
            black ? 'assets/images/bt_icon_back.png' : 'assets/images/bt_icon_back_white.png',
            width: 20,
            height: 17,
          ),
          onPressed: () {
            context.router.back();
          }));
}
